From 3a57a3f13da6a44fed073c02f98e0d6df471fb1a Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Mon, 2 Oct 2006 21:30:51 -0600 Subject: [PATCH] [IA64] Prevent domains to itc/ptd in shared_info_va. Signed-off-by: Tristan Gingold --- xen/arch/ia64/xen/vcpu.c | 11 ++++++++++- xen/include/public/arch-ia64.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/xen/arch/ia64/xen/vcpu.c b/xen/arch/ia64/xen/vcpu.c index cab06b2576..fdf7b6c8a5 100644 --- a/xen/arch/ia64/xen/vcpu.c +++ b/xen/arch/ia64/xen/vcpu.c @@ -1314,12 +1314,21 @@ static inline int range_overlap (u64 b1, u64 e1, u64 b2, u64 e2) static inline void check_xen_space_overlap (const char *func, u64 base, u64 page_size) { + /* Overlaps can occur only in region 7. + (This is an optimization to bypass all the checks). */ + if (REGION_NUMBER(base) != 7) + return; + /* Mask LSBs of base. */ base &= ~(page_size - 1); /* FIXME: ideally an MCA should be generated... */ if (range_overlap (HYPERVISOR_VIRT_START, HYPERVISOR_VIRT_END, - base, base + page_size)) + base, base + page_size) + || range_overlap(current->domain->arch.shared_info_va, + current->domain->arch.shared_info_va + + XSI_SIZE + XMAPPEDREGS_SIZE, + base, base + page_size)) panic_domain (NULL, "%s on Xen virtual space (%lx)\n", func, base); } diff --git a/xen/include/public/arch-ia64.h b/xen/include/public/arch-ia64.h index aa51d3297d..62fbaf6dae 100644 --- a/xen/include/public/arch-ia64.h +++ b/xen/include/public/arch-ia64.h @@ -397,6 +397,7 @@ struct xen_ia64_boot_param { #define XSI_SIZE (1 << XSI_SHIFT) /* Log size of mapped_regs area (64 KB - only 4KB is used). */ #define XMAPPEDREGS_SHIFT 12 +#define XMAPPEDREGS_SIZE (1 << XMAPPEDREGS_SHIFT) /* Offset of XASI (Xen arch shared info) wrt XSI_BASE. */ #define XMAPPEDREGS_OFS XSI_SIZE -- 2.30.2